<!DOCTYPE html>
<html>

<head>
    <title>后台</title>
    <meta charset="utf-8">
    <!-- public -->
    <link rel="stylesheet" href="<?=HW_CSS?>font.css">
    <link rel="stylesheet" href="<?=HW_CSS?>base.css">
    <link rel="stylesheet" href="<?=HW_CSS?>bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="<?=HW_CSS?>style.css">
    <link rel="stylesheet" href="<?=HW_CSS?>main_content.css">
</head>
<body>

    <form class="form-horizontal" action="" method="POST">
        <!-- toolbar_container -->
        <div id="toolbar_container">
            <div class="tb_item">
                <button type="submit">保存</button>
            </div>
        </div>

        <!-- 基本信息 -->
        <div class="panel-group">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h4 class="panel-title">
                        <a role="button" data-toggle="collapse" href="#collapseOne">
                            基本信息
                        </a>
                    </h4>
                </div>
                <div id="collapseOne" class="panel-collapse collapse in">
                    <div class="panel-body">
                        <div class="form-group">
                            <label for="" class="col-sm-2 control-label">权限组名称<span>*</span>：</label>
                            <div class="col-sm-3">
                                <input type='hidden' name='id' value="<?=isset($auth)?$auth['id']:'0'?>">
                                <input type="text" class="form-control" name="name" required value="<?=isset($auth)?$auth['name']:''?>" <?php if(isset($auth)){echo 'readonly';} ?>>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!-- 权限信息 -->
        <div class="panel-group">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h4 class="panel-title">
                        <a role="button" data-toggle="collapse" href="#collapseTwo">
                            权限信息
                        </a>
                    </h4>
                </div>
                <div id="collapseTwo" class="panel-collapse collapse in">
                    <div class="panel-body">
                        <?php if(isset($module)){foreach($module as $val): ?>
                            <div class="form-group">
                                <label for="" class="col-sm-2 control-label"><?=$val['modulename']?>：</label>
                                <div class="col-sm-8">
                                    <div class="col-sm-12">

                                        <label class="checkbox-inline">
                                            <input type="checkbox" <?=isset($auth)&&array_key_exists($val['authname'],$auth['authlist'])&&in_array('add',$auth['authlist'][$val['authname']])?'checked':''?>  name="authlist[<?=$val['authname']?>][]" value="add"> 增改
                                        </label>
                                        <label class="checkbox-inline">
                                            <input type="checkbox" <?=isset($auth)&&array_key_exists($val['authname'],$auth['authlist'])&&in_array('del',$auth['authlist'][$val['authname']])?'checked':''?> name="authlist[<?=$val['authname']?>][]" value="del"> 删除
                                        </label>
                                        <!-- <label class="checkbox-inline">
                                            <input type="checkbox" name="authlist[<?=$val['authname']?>][]" value="edit"> 修改
                                        </label> -->
                                        <label class="checkbox-inline">
                                            <input type="checkbox" <?=isset($auth)&&array_key_exists($val['authname'],$auth['authlist'])&&in_array('select',$auth['authlist'][$val['authname']])?'checked':''?> name="authlist[<?=$val['authname']?>][]" value="select"> 查看
                                        </label>
                                        <label class="checkbox-inline">
                                            <input type="checkbox" <?=isset($auth)&&array_key_exists($val['authname'],$auth['authlist'])&&in_array('reviewed',$auth['authlist'][$val['authname']])?'checked':''?> name="authlist[<?=$val['authname']?>][]" value="reviewed"> 审核
                                        </label>
                                        <label class="checkbox-inline">
                                            <input type="checkbox" <?=isset($auth)&&array_key_exists($val['authname'],$auth['authlist'])&&in_array('all',$auth['authlist'][$val['authname']])?'checked':''?> name="authlist[<?=$val['authname']?>][]" value="all"> 查看所有
                                        </label>
                                    </div>
                                </div>
                            </div>
                        <?php endforeach; }?>

                    </div>
                </div>
            </div>
        </div>
    </form>

    <script src="<?=HW_STA?>lib/require.js" data-main="<?=HW_STA?>module/setting/setting.js"></script>
</body>

</html>